// import 'package:bst_web/common/base/http.dart';
import 'package:dio/dio.dart';

import 'view.dart';
import 'package:flutter_mvc/flutter_mvc.dart';
///Description:逛市场
///Author:teihideharu
///date created 2021/04/29
class MarketController extends BaseController {
   MarketController():super(MarketPage());
   int index=0;
   @override
   void initState(){
       super.initState();

       // http();
   }
  void http() async {
    // const url="http://api.youpizhijia.com/index/recommend-app-v2";
    const url="https://ypzj-oss.oss-cn-zhangjiakou.aliyuncs.com/bosutong-img/20221031142258zGny3AtR2kWFcstaewCE.png";
    // const url="https://c-ssl.duitang.com/uploads/blog/202105/04/20210504062111_d8dc3.jpg";
    final para={
      "market_id":"",
      "is_hezuo":"0",
    };

    final dio=Dio();

    // dio.options.headers={
    //   "Access-Control-Allow-Origin":"*",
    //   "Access-Control-Allow-Methods":'GET,POST,PUT',
    //   'Access-Control-Allow-Headers':'access-control-allow-origin,content-type',
    //   // "Access-Control-Expose-Headers":"*",
    // };

    dio.options.method = "GET";
    dio.options.headers["Access-Control-Allow-Origin"] = "*";
    dio.options.headers["Access-Control-Allow-Credentials"] = true;
    dio.options.headers["Access-Control-Allow-Headers"] =
    "Origin,Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,locale";
    dio.options.headers["Access-Control-Allow-Methods"] =
    "GET, HEAD, POST, OPTIONS";


    // final result=await dio.get(url,queryParameters: para);
    // print(result);
    // return Market1Bean(await httpGetNot401(url, para));
  }



  void onTabClick(int thisIndex) {
     index=thisIndex;
     setState();
  }
   
}
